package lab02.test26;

import java.util.Scanner;

/**
 * Created by 婷婷 on 2017/11/13.
 */
public class Test26 {
    public static void main(String[] args) {
        System.out.println("请输入除数：");

        //在try语句中运行可能出错的语句
        try {
            Scanner number = new Scanner(System.in);

            int divisor = number.nextInt();
            System.out.println("请输入被除数：");
            int dividend = number.nextInt();
            System.out.println(+dividend/divisor);
        }catch (ArithmeticException e){
            System.out.println("捕捉到的错误：输入的除数为0");
        }finally {
            System.out.println("默认输出语句：您输入的数据错误！");
        }

    }
}
